<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Executes a prepared Query</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mysqlnduhpreparedstatement.construct.html">MysqlndUhPreparedStatement::__construct</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mysqlnduhpreparedstatement.prepare.html">MysqlndUhPreparedStatement::prepare</a></div>
 <div class="up"><a href="class.mysqlnduhpreparedstatement.html">MysqlndUhPreparedStatement</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="mysqlnduhpreparedstatement.execute" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">MysqlndUhPreparedStatement::execute</h1>
  <p class="verinfo">(PECL mysqlnd-uh &gt;= 1.0.0-alpha)</p><p class="refpurpose"><span class="refname">MysqlndUhPreparedStatement::execute</span> &mdash; <span class="dc-title">Executes a prepared Query</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mysqlnduhpreparedstatement.execute-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><strong>MysqlndUhPreparedStatement::execute</strong></span>
    ( <span class="methodparam"><span class="type"><span class="type mysqlnd_prepared_statement">mysqlnd_prepared_statement</span></span> <code class="parameter">$statement</code></span>
   )</div>

  <p class="para rdfs-comment">
   Executes a prepared Query.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-mysqlnduhpreparedstatement.execute-parameters">
  <h3 class="title">参数</h3>
  <dl>

   
    <dt>
<em><code class="parameter">statement</code></em></dt>

    <dd>

     <p class="para">
      Mysqlnd prepared statement handle. Do not modify!
      Resource of type <em>Mysqlnd Prepared Statement (internal only - you must not modify it!)</em>.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-mysqlnduhpreparedstatement.execute-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns <strong><code>TRUE</code></strong> on success.
   Otherwise, returns <strong><code>FALSE</code></strong>
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-mysqlnduhpreparedstatement.execute-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-1898">
    <p><strong>Example #1 <span class="function"><strong>MysqlndUhPreparedStatement::execute()</strong></span> example</strong></p>
        <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">stmt_proxy&nbsp;</span><span style="color: #007700">extends&nbsp;</span><span style="color: #0000BB">MysqlndUhPreparedStatement&nbsp;</span><span style="color: #007700">{<br />&nbsp;public&nbsp;function&nbsp;</span><span style="color: #0000BB">execute</span><span style="color: #007700">(</span><span style="color: #0000BB">$res</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"%s("</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">__METHOD__</span><span style="color: #007700">);<br />&nbsp;&nbsp;</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$res</span><span style="color: #007700">);<br />&nbsp;&nbsp;</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">")\n"</span><span style="color: #007700">);<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$ret&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">parent</span><span style="color: #007700">::</span><span style="color: #0000BB">execute</span><span style="color: #007700">(</span><span style="color: #0000BB">$res</span><span style="color: #007700">);<br />&nbsp;&nbsp;</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"%s&nbsp;returns&nbsp;%s\n"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">__METHOD__</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">var_export</span><span style="color: #007700">(</span><span style="color: #0000BB">$ret</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">));<br />&nbsp;&nbsp;</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$ret</span><span style="color: #007700">);<br />&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">$ret</span><span style="color: #007700">;<br />&nbsp;}<br />}<br /></span><span style="color: #0000BB">mysqlnd_uh_set_statement_proxy</span><span style="color: #007700">(new&nbsp;</span><span style="color: #0000BB">stmt_proxy</span><span style="color: #007700">());<br /><br /></span><span style="color: #0000BB">$mysqli&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">mysqli</span><span style="color: #007700">(</span><span style="color: #DD0000">"localhost"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"root"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">""</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"test"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$mysqli</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">prepare</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT&nbsp;'Labskaus'&nbsp;AS&nbsp;_msg&nbsp;FROM&nbsp;DUAL"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$stmt</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">execute</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$msg&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">NULL</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$stmt</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">bind_result</span><span style="color: #007700">(</span><span style="color: #0000BB">$msg</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$stmt</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">fetch</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$msg</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
stmt_proxy::execute(resource(256) of type (Mysqlnd Prepared Statement (internal only - you must not modify it!))
)
stmt_proxy::execute returns true
bool(true)
string(8) &quot;Labskaus&quot;
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-mysqlnduhpreparedstatement.execute-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member">
     <span class="function"><a href="function.mysqlnd-uh-set-statement-proxy.html" class="function" rel="rdfs-seeAlso">mysqlnd_uh_set_statement_proxy()</a> - Installs a proxy for mysqlnd statements</span>
    </li>
    <li class="member">
     <span class="function"><a href="mysqli-stmt.execute.html" class="function" rel="rdfs-seeAlso">mysqli_stmt_execute()</a> - Executes a prepared Query</span>
    </li>
   </ul>
  </p>
 </div>




</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mysqlnduhpreparedstatement.construct.html">MysqlndUhPreparedStatement::__construct</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mysqlnduhpreparedstatement.prepare.html">MysqlndUhPreparedStatement::prepare</a></div>
 <div class="up"><a href="class.mysqlnduhpreparedstatement.html">MysqlndUhPreparedStatement</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
